package com.foreveross.util;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.foreveross.vo.SysUser;

public class AuthUtil {

	public static boolean isUserAuth(HttpServletRequest httpReq, String userid) {
		SysUser sysUser = (SysUser) httpReq
				.getSession().getAttribute(userid);
		if (sysUser != null)
			return true;
		return false;
	}

	public static String getUserid(HttpServletRequest httpReq) {
		String key = "userId";
		String userid = httpReq.getParameter(key);
		if (isUserAuth(httpReq, userid))
			return userid;
		else
			return null;

	}

}
